package com.china.soft;

import java.io.IOException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.env.Environment;

/**
 * @desc 应用配置客户端demo
 * @class com.china.soft.ConfigClientApplicatoin
 * @author suan@chinasoftinc.com
 * @version V1.0
 */
@SpringBootApplication
public class ConfigClientApplicatoin {

    @Autowired
    void setEnvironment(Environment env) {
        System.out.println(
                "mysqldb.datasource.username from env: " + env.getProperty("mysqldb.datasource.username"));
    }

    public static void main(String[] args) {
        SpringApplication.run(ConfigClientApplicatoin.class, args);
        try {
            System.in.read();
        } catch (IOException e) {
            e.printStackTrace();
            e = null;
        }
    }

}
